package net.cyndeline.rldungeon.grammar.production

import scalax.collection.immutable.Graph
import net.cyndeline.rldungeon.grammar.util.Morphism
import scalax.collection.GraphEdge.UnDiEdge
import net.cyndeline.rldungeon.dgs.graph.{DGSFunctionality, Room}
import scalax.collection.GraphPredef.OuterEdge

/**
 * Interface for classes that modify a graph. Used for injection.
 */
trait GraphProduction[VType <: Room[VType], EType[X] <: UnDiEdge[X] with DGSFunctionality[X, EType] with OuterEdge[X, EType]] {
  def apply(graph: Graph[VType, EType]): Option[Graph[VType, EType]]
  def getMatch(graph: Graph[VType, EType]): Option[Morphism[VType]]
}
